/**
* Copyright 2009 Waag Society <http://www.waag.org>
* This file is part of Annotrax.
*
* Annotrax is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License,
* or (at your option) any later version.
*
* Annotrax is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Annotrax.
* If not, see http://www.gnu.org/licenses/gpl.html
*/

self.AnnotationInfo = function(container)
{
	this.el_main = Element("div",{className:"annotation_info"},container)
	$(document).bind("player_item_start",bind(this,"onPlayerItemStart"));
}
AnnotationInfo.prototype.onPlayerItemStart = function(evt,playlist_item)
{
	movie = playlist_item.movie;
	
	$(this.el_main).empty()

	left_content = Element("div",{className:"ai_left"},this.el_main)
	right_content = Element("div",{className:"ai_right"},this.el_main)

	Element("img",{src:"/frame/thumbnail/"+movie.id+"/"+playlist_item.time},left_content)
	
	title_p = Element("p",{},right_content)
	Element("h3",{},title_p,movie["title"])
	
	desc_p = Element("p",{},right_content)
	Element("strong",{},title_p,movie["description"])
	
	start_end_p = Element("p",{},right_content,"")
	Element("div",{className:"ai_start ui-corner-all"},start_end_p,AnnotraxTime.secondsToTimeString(playlist_item.getBeginTime()))
	Element("div",{className:"ai_end ui-corner-all"},start_end_p,AnnotraxTime.secondsToTimeString(playlist_item.getEndTime()))
	
	props_p = Element("p",{},right_content,"")
	table = Element("table",{},props_p)
	table.style.overflow = "auto";	
	
	show_props = ["creator","publisher","rights"]
	for(var i=0;i<show_props.length;i++)
	{
		prop = show_props[i];
		if(movie[prop])
		{
			row = Element("tr",{},table)
			Element("td",{},row,prop)
			Element("td",{},row,movie[prop])
		}
	}

	orig_p = Element("p",{},right_content,"")
	Element("a",{href:"/movie/play/"+movie.id},orig_p,"original movie")
	
}
AnnotationInfo.prototype.layoutProperty = function(container,property,value)
{
	

}

